package com.example.start

import android.util.SparseArray
import androidx.lifecycle.ViewModelProvider
import com.example.BR
import com.example.R
import com.example.library_base.base.BaseEventHandler
import com.example.library_base.base.BaseFragment
import dagger.hilt.android.AndroidEntryPoint

/**
 * 启动广告页面
 * */
@AndroidEntryPoint
class SplashFragment : BaseFragment<SplashModel, SplashViewModel>(R.layout.fragment_splash){
    companion object{
        fun newInstance() = SplashFragment()
    }

    override fun getViewModel(): SplashViewModel {
        return createViewModel(SplashViewModel::class.java, ViewModelProvider.NewInstanceFactory())
    }

    override fun getVariableSparseArray(): SparseArray<Any> {
        val variables = SparseArray<Any>()
        variables.put(BR.splashViewModel, mViewModel)
        return variables
    }

    override fun getEventHandler(): BaseEventHandler {
        return createEventHandler(BaseEventHandler::class.java)
    }

    override fun initData() {
    }

    override fun requestData() {
    }

}